<template>
  <!-- 密码 -->
  <u-popup v-model="show" mode="bottom" border-radius="14">
    <div class="pup">
      <view class="title u-font-30 u-flex u-col-center u-row-between">
        <text class="p0">设置密码</text>
        <u-icon name="close" color="#aaa" size="26" @click="show = false"></u-icon>
      </view>
      <u-input type="password" placeholder="请输入密码" v-model="password" class="text" ></u-input>
      <u-button type="primary" class="call-btn u-font-30" @click="pupSubmit">提交</u-button>
      <zb-ipx />
    </div>
  </u-popup>
  
</template>

<script>
  export default {
    name:"zb-jiaofei",
    props: {
      title: {
        default: '暂无数据'
      },
      top: {
        default: '0'
      },
    },
    data() {
      return {
        show:false,
        password:'',
        info:null
      };
    },
    methods:{
      showFun(datas){
        this.show = true;
        this.info = datas
      },
      pupSubmit(){
        this.$api.setLockPasswordApi({ordersNo: this.info.tenancy_order_sn, password:this.password}).then(res=>{
          if(res.code === 1){
            uni.showToast({ title: '密码设置成功', icon:'none' })
            this.$emit('ok', this.password)
            this.show = false;
            this.password = '';
          }else{
            uni.showToast({ title: res.msg, icon:'error' })
          }
          
        })
      },
    }
  }
</script>

<style lang="scss" scoped>
.pup{
  padding: 0 30rpx; width:750rpx; box-sizing: border-box;
  .title{font-size: 30rpx; height: 90rpx; border-bottom: 1px solid #ededed; margin: 0 -30rpx 20rpx; padding: 0 30rpx;}
  .p0{font-size: 30rpx;}
  .call-btn{width: 100%; margin: 60rpx 0; box-sizing: border-box;}
  .text{border: 1px solid #ddd; border-radius: 10rpx; padding: 0 20rpx !important; margin-bottom: 20rpx; display: flex;}
}
</style>